<template>
  <ul class="contact-container" v-if="setting">
    <li class="github">
      <a :href="setting.github" target="_blank">
        <Icon type="github" />
        <span>{{setting.githubName}}</span>
      </a>
    </li>
    <li class="mail">
      <a class="mail" :href="`mialto:${setting.mail}`">
        <Icon type="mail" />
        <span>{{setting.mail}}</span>
      </a>
    </li>
    <li class="qq">
      <a class="qq" :href="`tencent://message/?Menu=yes&uin=${setting.qq}&Service=300&sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45`">
        <Icon type="qq" />
        <span>{{setting.qq}}</span>
      </a>
      <div class="pop">
        <img :src="setting.qqQrCode" class="qrCode" />
      </div>
    </li>
    <li class="weixin">
      <a class="weixin">
        <Icon type="weixin" />
        <span>{{setting.weixin}}</span>
      </a>
      <div class="pop">
        <img :src="setting.weixinQrCode" class="qrCode" />
      </div>
    </li>
  </ul>
</template>

<script>
import Icon from "./Icon.vue";

export default {
  components: {
    Icon,
  },
  computed: {
    setting(){
      return this.$store.state.setting.setting
    }
  }
};
</script>

<style scoped lang="less">
@import "../styles/color.less";

.contact-container {
  width: 100%;
  li {
    height: 50px;
    line-height: 50px;
    width: 100%;
    position: relative;
    color: @gray;
    &:hover {
      color: @primary;
      .pop {
        transform: scaleY(1);
      }
    }
    .pop {
      padding: 10px 15px;
      border-radius: 5px;
      background-color: #fff;
      position: absolute;
      left: 30px;
      bottom: 50px;
      transform-origin: bottom;
      transform: scaleY(0);
      transition: 0.2s;
      img {
        width: 150px;
        height: 150px;
        display: block;
      }
      &::after {
        content: "";
        position: absolute;
        width: 8px;
        height: 8px;
        background-color: #fff;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        bottom: -4px;
      }
    }
    a {
      display: flex;
      align-items: center;
      padding: 0 13px;
      cursor: pointer;
      .icon-container {
        font-size: 25px;
        margin-right: 8px;
      }
      &.weixin .icon-container {
        font-size: 29px;
        text-indent: -2px;
      }
    }
  }
}
</style>